<template>
	<Layout class="p-5 bg-white">
		
		<Form :label-width="80">
           
           <Row>
			   <Col >
				   <FormItem class="w-100" label="标题">
				   	<Input type="text" v-model="title" style="width: 500px;"/>
				   </FormItem>
				   <FormItem class="w-100" label="联系人">
				   	<Input type="text" v-model="personName" style="width: 500px;"/>
				   </FormItem>
				   <FormItem class="w-100" label="电话">
				   	<Input type="text" v-model="tel" style="width: 500px;"/>
				   </FormItem>
				   <FormItem class="w-100" label="微信号">
				   	<Input type="text" v-model="wxNumber" style="width: 500px;"/>
				   </FormItem>
				   <FormItem class="w-100" label="描述">
				   	<Input type="textarea" :rows="6" v-model="details" style="width: 500px; height: 150px;"/>
				   </FormItem>
				   <FormItem >
						   <Button @click="submit" type="primary">提交</Button>
						   <Button @click="cancel" class="ml-2">取消</Button>
				   </FormItem>
				  
			   </Col>
		   </Row>
          
		</Form>		

		
	</Layout>
</template>

<script>
	export default {
		data: function() {
			return {
				title:"",
				details:"",
				clientId: 0	,
				tel:'',
				wxNumber:'',
				personName:''
			};
		},
		methods: {
			submit(){
				if (this.$data.title.length === 0) {
					this.message.error("标题必须输入");
					return;
				}
				
				let self = this;
						console.log(self.$data.clientId)
						this.http.post({
							url: "/car-buy-client-vo/info",

							param: {
								title: self.$data.title,
								details: self.$data.details,
								tel: self.$data.tel,
								wxNumber: self.$data.wxNumber,
								personName:self.$data.personName,
								clientId: self.$data.clientId

							}
						}).then(data => {
							self.message.info("新增成功");
							this.$tabs.close();
                            this.$router.push({
                            	name: "carBuy"
                            });
						});
					},
					cancel: function() {
						this.$tabs.close();
					}
				},
				created(){
					var cli = this.local.session.getItem("CURRENT");
					this.clientId = cli.client.clientId;
				}
				
			}
			
</script>

<style scoped="scoped">
	div{
		float: left;		
	}
	
	
	
</style>
